package com.lineage.data.event;

import com.lineage.data.executor.EventExecutor;
import com.lineage.server.templates.L1Event;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

public class ProtectorSet extends EventExecutor {
  private static final Log _log = LogFactory.getLog(ProtectorSet.class);
  
  public static int ITEM_ID;
  
  public static int CHANCE;
  
  public static int DROP_LIMIT;
  
  public static int HP_UP;
  
  public static int MP_UP;
  
  public static int DMG_UP;
  
  public static int DMG_DOWN;
  
  public static int SP_UP;
  
  public static boolean DEATH_VALUE_EXP;
  
  public static boolean DEATH_VALUE_ITEM;
  
  public static EventExecutor get() {
    return new ProtectorSet();
  }
  
  public void execute(L1Event event) {
    try {
      String[] set = event.get_eventother().split(",");
      ITEM_ID = Integer.parseInt(set[0]);
      CHANCE = Integer.parseInt(set[1]);
      DROP_LIMIT = Integer.parseInt(set[2]);
      HP_UP = Integer.parseInt(set[3]);
      MP_UP = Integer.parseInt(set[4]);
      DMG_UP = Integer.parseInt(set[5]);
      DMG_DOWN = Integer.parseInt(set[6]);
      SP_UP = Integer.parseInt(set[7]);
      DEATH_VALUE_EXP = Boolean.parseBoolean(set[8]);
      DEATH_VALUE_ITEM = Boolean.parseBoolean(set[9]);
    } catch (Exception e) {
      _log.error(e.getLocalizedMessage(), e);
    } 
  }
}
